<template>
  <div class="home">
    <div class="sweper">
      <el-carousel
        :interval="3000"
        type="card"
        height="260px"
        indicator-position="none"
      >
        <el-carousel-item v-for="item in img" :key="item">
          <img :src="item.img" alt="" style="width: 100%" />
        </el-carousel-item>
      </el-carousel>
    </div>
    <div class="home-header">
      <div class="echarts">
        <ehcars></ehcars>
      </div>
      <div class="echarts">
        <ehcars1></ehcars1>
      </div>
      <!-- <div class="echarts">
        <ahcarsAddress></ahcarsAddress>
      </div> -->
    </div>
  </div>
</template>

<script lang="ts" setup>
import img1 from '../../assets/home/img1.jpg'
import img2 from '../../assets/home/img2.jpg'
import img3 from '../../assets/home/img3.jpg'
import ehcars from './components/ehcars.vue'
import ehcars1 from './components/ehcars1.vue'
import ahcarsAddress from './components/ahcarsAddress.vue'
const components = {
  ehcars1,
  ehcars,
  ahcarsAddress,
}
const img = [
  {
    img: img1,
    url: '',
  },
  {
    img: img2,
    url: '',
  },
  {
    img: img3,
    url: '',
  },
]
</script>

<style lang="scss">
.home {
  width: 100%;
  margin: 8px auto;
  .home-header {
    height: 400px;
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    // align-content: space-evenly;
    @media screen and (max-width: 768px) {
      flex-wrap: wrap;
      .echarts {
        margin-bottom: 10px;
      }
    }
    .echarts {
      width: 48%;
      height: 100%;
      border-radius: 5px;
      background: white;
      //   padding: 10px 0;
      .container {
        padding-top: 10px;
        width: 100%;
        height: 100%;
      }
      &:last-child {
        margin-right: 0;
      }
    }
  }
  .sweper {
    background: white;
    border-radius: 5px;
    padding: 20px 20px;
    .el-carousel__item h3 {
      color: #475669;
      opacity: 0.75;
      line-height: 200px;
      margin: 0;
      text-align: center;
    }

    .el-carousel__item:nth-child(2n) {
      background-color: #99a9bf;
    }

    .el-carousel__item:nth-child(2n + 1) {
      background-color: #d3dce6;
    }
  }
}
</style>
